package com.ssm.juc.synchronized1;

import org.openjdk.jol.info.ClassLayout;

/**
 * 延迟偏向
 * 
 * 1.无锁状态
 * 2.匿名偏向
 */
public class BiasedLockDelayTest {

    public static void main(String[] args) throws InterruptedException {
        Object obj1 = new Object();
        //1.无锁状态
        System.out.println(ClassLayout.parseInstance(obj1).toPrintable());
        System.out.println();
        Thread.sleep(5000);
        //2.匿名偏向
        Object obj2 = new Object();
        System.out.println(ClassLayout.parseInstance(obj2).toPrintable());
    }
}